package com.source.action;

import java.util.Map;

import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;
import com.source.utilidad.ObjetoMenu;

public class LocaleAction extends ActionSupport {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private Map session;
	private String scritpMenu;
	private String name;
	
	public Map getSession() {
		return session;
	}

	public void setSession(Map session) {
		this.session = session;
	}	
	
	public String getScritpMenu() {
		return scritpMenu;
	}

	public void setScritpMenu(String scritpMenu) {
		this.scritpMenu = scritpMenu;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	// business logic
	public String execute() {
		System.out.println(" metodo idioma 1");
		Map session = ActionContext.getContext().getSession();
		String idioma = session.get("WW_TRANS_I18N_LOCALE").toString();
		setSession(session);
		ObjetoMenu om = new ObjetoMenu(idioma);
		setScritpMenu(om.getMenu().get("stringMenu").toString());
		session.put("menu", om.getMenu().get("stringMenu").toString());
		setName("MARCO GUADO ZAVALETA");
		return "inicio";
	}


}
